<?php
/**
 * Created by PhpStorm.
 * User: wx:wenyi2048
 * Date: 2022/6/22 0022
 * Time: 09:18
 */

namespace app\admin\controller\mk;


use app\admin\Controller;
use app\common\service\SpoilsService;


\think\Loader::import('controller/Controller', \think\Config::get('traits_path'), EXT);


class Spoils extends Controller
{
    use \app\admin\traits\controller\Controller;

    public function index(){
        $param = $this->request->param();
        $service = new SpoilsService();//数据处理
        $service->searchPage($this->view,$param);
        return $this->view->fetch();
    }

    public function edit()
    {
        $param = $this->request->param();
        $service = new SpoilsService();//数据处理
        if ($this->request->isAjax()) {
            // 插入
            
        } else {
            // 添加准备
            $optionId = $this->request->param('option_id');
            $storeId = getAdminStoreId($this->request->param('sms_stores_id'));
            $oService = new OptionsService();
            $data = $oService->getOptionService($optionId,$storeId);
            $this->view->assign('vo',$data);
            return $this->view->fetch('edit');
        }

        return $this->view->fetch();
    }
}